跳转至

超越每字母两字节:西里尔文 AI 系统中的分词开销

文章背景与核心概要

现代多语言大模型的分词器(Tokenizer)在处理乌克兰语及其他资源相对匮乏的西里尔文字母语言时,往往比处理英语产生更碎片的编码,从而在计算成本和上下文窗口容量上造成了显著的差距。本文针对 9 种主流生产级分词器、5 种语言以及 837 万个词形进行了全面量化研究,揭示了西里尔文分词开销的严重程度及其根本原因。

研究发现,在现代分词器上,乌克兰语的Token开销高达 68%–121%,而在较旧的模型(如 cl100k)上甚至高达 220%。这种现象主要源于训练数据的分配偏向网络训练数据中更常见的文字脚本。为了缓解这一问题,论文提出了两阶段的应对策略:在推理阶段,使用 LLMLingua-2 能够在不损失检索价值的前提下将乌克兰语输入长度缩减 47%–49%;在分词器设计阶段,通过构建限制在 200K 词表内的平衡字节级 BPE 分词器,可将保留集的乌克兰语/英语 Token 比例从 2.22 倍降至 1.30 倍。此外,有趣的是,将乌克兰语文本进行罗马化(转写为拉丁字母)反而会使大多数分词器的 Token 数量增加 2%–19%。


Beyond Two Bytes per Letter: Tokenization Overhead in Cyrillic AI Systems

arXiv: 2608.21384 [cs.CL]
Submitted on: 17 Jul 2026
Authors: Ivan Dobrovolskyi
Subjects: Computation and Language (cs.CL); Artificial Intelligence (cs.AI)
License: CC BY 4.0 license icon


Summary

现代多语言 AI 分词器通常比英语更严重地碎片化乌克兰语和其他代表性不足的西里尔文语种,从而在计算成本和上下文窗口容量方面引入了显著的差异。本文在九种生产级分词器五种语言以及 837 万个词形的范围内量化了这种分词开销。

该研究的主要发现和提出的解决方案包括: * 量化开销: 乌克兰语在现代分词器上表现出 68–121% 的 Token 开销,在像 cl100k 这样的旧模型上则高达 220%。 * 根本原因: 分析表明,训练数据的分配严重影响了分词效率,这自然偏向于网络训练数据中更普遍存在的字符脚本。 * 缓解策略: * 推理阶段: LLMLingua-2 在电子商务 RAG 基准测试中成功将乌克兰语输入长度减少了 47–49%,且检索价值没有损失。 * 分词器设计阶段: 一个平衡的字节级 BPE 分词器(词表上限为 200K)将保留的乌克兰语/英语 Token 比例从 2.22 倍降低至 1.30 倍。 * 罗马化影响: 有趣的是,在大多数测试的分词器中,将乌克兰语文本罗马化实际上会使 Token 数量增加 2–19%。

Modern multilingual AI tokenizers often fragment Ukrainian and other underrepresented Cyrillic-script languages far more heavily than English, introducing significant disparities in computational costs and context window capacities. This paper quantifies this tokenization overhead across nine production tokenizers, five languages, and 8.37 million word forms.

Key findings and solutions proposed in the study include: * Quantified Overhead: Ukrainian exhibits a 68–121% token overhead on modern tokenizers, and up to 220% on older models like cl100k. * Root Cause: Analysis suggests that training data allocation heavily influences tokenization efficiency, which naturally favors scripts more prevalent in web training data. * Mitigation Strategies: * Inference-stage: LLMLingua-2 successfully reduces Ukrainian input length by 47–49% on an e-commerce RAG benchmark without any value losses in retrieval. * Tokenizer-design stage: A balanced byte-level BPE tokenizer (capped at 200K vocabulary) reduces the held-out UK/EN token ratio from 2.22x down to 1.30x. * Romanization Impact: Interestingly, romanizing Ukrainian text actually increases token counts by 2–19% across most tested tokenizers.


Abstract

现代多语言分词器通常比英语更严重地碎片化乌克兰语和其他资源较少的西里尔文语种,这在成本和上下文容量方面造成了差异。我们在九种生产分词器和五种具有标准化西里尔字母和拉丁字母表示的语言中,对这种开销进行了量化,涵盖了 837 万个词形。在语料库基准测试中,通过对 BrUK 和 Brown 语料库的全文本词形丰度(fertility)进行测量,乌克兰语在现代分词器上显示出 68-121% 的 Token 开销,在较旧的 cl100k 上则为 220%。在具有独立验证的英语基线的子集中,开销与西里尔文词表分配呈负相关,尽管这种关联在统计上并不显著(Spearman rho = -0.536, p = 0.215, n = 7)。我们评估了两种缓解策略。LLMLingua-2 在包含 1,536 个产品和 145 个查询的电子商务 RAG 基准测试中,将乌克兰语输入长度减少了 47-49%,并且在 80 个可检索案例中没有因压缩而导致的价值损失。一个训练时词表上限为 200K、实际收敛于 158,184 个条目的平衡字节级 BPE 分词器,将保留的 UK/EN 比例从 2.22 倍降低至 1.30 倍。罗马化使大多数分词器的乌克兰语 Token 数量增加了 2-19%。在五种语言中,分词效率偏向于网络数据中更普遍存在的脚本。这些发现表明,训练数据分配会导致西里尔文分词开销,并且在推理和分词器设计阶段都可以采取缓解措施。

Modern multilingual tokenizers often fragment Ukrainian and other underrepresented Cyrillic-script languages more heavily than English, creating disparities in cost and context capacity. We quantify this overhead across nine production tokenizers and five languages with standardized Cyrillic and Latin representations, covering 8.37 million word forms. On a corpus benchmark, Ukrainian shows 68-121% token overhead on modern tokenizers and 220% on the older cl100k, measured through full-text fertility on the BrUK and Brown corpora. Overhead is negatively associated with Cyrillic vocabulary allocation in the subset with independently verified English baselines, although the association is not statistically significant (Spearman rho = -0.536, p = 0.215, n = 7). We evaluate two mitigation strategies. LLMLingua-2 reduces Ukrainian input length by 47-49% on an e-commerce RAG benchmark of 1,536 products and 145 queries, with no compression-induced value losses among 80 retrievable cases. A balanced byte-level BPE tokenizer trained with a 200K vocabulary cap, converging at 158,184 actual entries, reduces the held-out UK/EN ratio from 2.22x to 1.30x. Romanization increases Ukrainian token counts by 2-19% on most tokenizers. Across the five languages, tokenization efficiency favors the script more prevalent in web data. These findings indicate that training data allocation contributes to Cyrillic tokenization overhead and that mitigation is possible at both inference and tokenizer-design stages.


Access & Resources

访问与资源: